import { createBrowserRouter } from 'react-router-dom';
import App from '../App';
import Tables from '../views/sysUtils/Tables';
import { ToolOutlined } from '@ant-design/icons';

type ItemType = {
  path: string;
  element: React.ReactNode;
  icon?: React.ReactNode;
  title?: string;
  children?: ItemType[];
};
export const navList: ItemType[] = [
  {
    path: '/sys-utils',
    element: '',
    title: '系统工具',
    icon: <ToolOutlined />,
    children: [
      {
        path: '/sys-utils/tables',
        element: <Tables />,
        title: '代码生成',
      },
    ],
  },
];

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,
    children: navList,
  },
]);

export default router;
